<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>border-with-top-triangle</title>
    <style>
        .container {
            --borderColor--: #ddd;
            --bgColor--: #fff;
            position: relative;
            background-color: var(--bgColor--);
            padding: 15px;
            margin-top: 20px;
            border: 1px solid var(--borderColor--);
        }

        .container:before,
        .container:after {
            content: "";
            position: absolute;
            bottom: 100%;
            left: 19px;
            border: 11px solid transparent;
            border-bottom-color: var(--borderColor--);
        }

        .container:after {
            left: 20px;
            border: 10px solid transparent;
            border-bottom-color: var(--bgColor--);
        }
    </style>
</head>

<body>
    <div class="container">Border with top triangle</div>
</body>

</html>